<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>上传支付截图</title>
    <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <title></title>
    <link rel="stylesheet" href="__INDEX__/css/mui.min.css">
</head>
<style>
    .wsf-cl {
        color: #FFFFFF;
        padding-top: 10px;
        position: relative;
        top: 36%;
    }

    .uploadwsf {
        width: 100px;
        height: 100px;
        margin: 10px;
        border-radius: 18px;
    }

    .mui-input-row {
        background: #ffffff;
    }

</style>

<!-- 开发环境版本，包含了有帮助的命令行警告 -->
<script src="__FIR__/js/vue.js"></script>
<script src="__FIR__/js/vue.min.js"></script>
<script src="__FIR__/js/mui.min.js"></script>
<script type="text/javascript" src="__FIR__/index/js/jquery-3.3.1.js"></script>
<link rel="stylesheet" href="__FIR__/css/mobile-uploadImg.css">
<link rel="stylesheet" href="https://cdn.bootcss.com/layer/2.1/skin/layer.css">
<script src="https://cdn.bootcss.com/layer/2.1/layer.js"></script>

<body>

<div id="app">
    <div class="content" style="background: #FFFFFF;">
        <div class="web-width">
            <div class="for-liucheng">
                <div class="liulist for-cur"></div>
                <div class="liulist"></div>
                <div class="liulist"></div>
                <div class="liulist"></div>
                <div class="liutextbox" style="padding: 15px;">
                    <img src="__INDEX__/images/r3@2x.png" width="100%"/>
                </div>
            </div><!--for-liucheng/-->
            <div class="ht1"></div>
            <form action="{:url('/nThree')}" method="post" enctype="multipart/form-data" class="forget-pwd">
                <div class="mui-content">

                    <div class="mui-input-row">
                        <label>上传支付截图</label>
                    </div>
                    <div style="margin:20px 10px;">

                        <div style="margin-top:20px;">
                            <div id="uploadImgForm3" class="uploadImgStyle2">
                                <div class="mbupload_frame" id="imageBgc3"
                                     style="background:url(__FIR__/img/jt.png) no-repeat 50% 50%;">
                                    <div class="mbupload_photoList">
                                        <ul>
                                            <li class="mbupload_on mbupload_addPic mbupload_addImg"></li>
                                        </ul>
                                        <p class="mbupload_textTip mbupload_f12">上传支付成功截图</p>
                                    </div>
                                    <div class="mbupload_bgimg">
                                        <div class="iconSendImg mbupload_addImg"><input type="file" ref="image3" name="img3"
                                                                                        @change="uploadImgs(3)"></div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        </div>
                    </div>
                <button type="submit" class="mui-btn mui-btn-danger mui-btn-block">下一步</button>
            </form>
        </div>
    </div>
    <div style="height: 46px;"></div>
    <br><br><br>
    <link rel="stylesheet" href="__INDEX__/css/footer.css">
    <br><br><br>
    {include file="common/foot"}
</div>
</body>

<script>
    var app = new Vue({
        el: '#app',
        data() {
            return {
                imgList: [],
                size: 0,
                img1: '1',
                img2: '',
                img3: '',
            }
        },
        methods: {
            uploadImgs(id) {
                var that = this
                if (id == 1) {
                    var imageObj1 = this.$refs.image1.files[0]
                    var fileReader = new FileReader();
                    fileReader.readAsDataURL(imageObj1);
                    fileReader.onload = function (e) {
                        $("#imageBgc1").css('background-image', 'url(' + e.target.result + ')');
                        $("#imageBgc1").css('background-size', '100%');
                        that.img1 = e.target.result
                    }
                } else if (id == 2) {
                    var imageObj2 = this.$refs.image2.files[0]
                    var fileReader = new FileReader();
                    fileReader.readAsDataURL(imageObj2);
                    fileReader.onload = function (e) {
                        $("#imageBgc2").css('background-image', 'url(' + e.target.result + ')');
                        $("#imageBgc2").css('background-size', '100%');
                        that.img2 = e.target.result
                    }

                } else if (id == 3) {
                    var imageObj3 = this.$refs.image3.files[0]
                    var fileReader = new FileReader();
                    fileReader.readAsDataURL(imageObj3);
                    fileReader.onload = function (e) {
                        $("#imageBgc3").css('background-image', 'url(' + e.target.result + ')');
                        $("#imageBgc3").css('background-size', '100%');
                        that.img3 = e.target.result
                    }

                }
            },

            SubmitsRZ() {
                var state = this.$refs.state_id.value;
                // 在处于 0 状态下
                if (state == 0) {
                    if (this.img1 == '' || this.img2 == '' || this.img3 == '') {
                        layer.msg('身份证正面，反面以及支付截图!');
                        return
                    }
                    var reg = /^1[3|4|5|7|8][0-9]{9}$/; //验证规则
                    var flag = reg.test(this.phone); //true
                    if (!flag) {
                        layer.msg('手机号不正确')
                        return;
                    }
                    reg = /^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$|^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/      //身份证验证
                    flag = reg.test(this.sfz); //true
                    if (!flag) {
                        layer.msg('身份证号不正确')
                        return;
                    }

                }


            }
        }
    })

</script>
</html>